// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import ElementUI from 'element-ui';

import axios from 'axios';
Vue.prototype.axios = axios
axios.defaults.withCredentials = true;
// axios.defaults.baseURL='http://hzxh.xclearn.com/c_api';

import 'element-ui/lib/theme-chalk/index.css';
import VueCookies from 'vue-cookies'
Vue.use(VueCookies)

Vue.use(ElementUI);


import common from "./assets/basejs/common"
Vue.prototype.common = common;
import "./assets/basejs/base"
import api from "./assets/basejs/config"
Vue.prototype.api = api;
console.log(api);

var url = "";
console.log(process.env.NODE_ENV)
if (process.env.NODE_ENV == "development") {
      url = '/static/config-dev.json';
  } else if (process.env.NODE_ENV == "test") {
        url = '/static/config-test.json';
} else if (process.env.NODE_ENV == "prod") {
    url = '/static/config-prod.json';
}

axios.get(url).then(function(res) {
      console.log("查看封装好的baseurl 等各种配置",res.data);
      api.setConfig(res.data);
  });
  
  /* eslint-disable no-new */ 
  var vue = new Vue({
    el: '#app',
    router,
  components: { App },
  template: '<App/>'
})

import $sdk from "hammer-base-sdk"
Vue.prototype.$sdk = $sdk(vue);
console.log("琛哥封装的方法",Vue.prototype.$sdk)

// 设置开发  或什么模式
Vue.config.productionTip = false